package com.scau.XFourPOS.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.hibernate.Query;
import org.hibernate.Session;

import com.scau.XFourPOS.utils.PageUtils;

/**
 * 类名称：BaseDao<T> 类描述：dao接口，泛型类 创建人：庄祥鹏
 * */
public interface BaseDao<T> {
	public Session getSession();

	public void saveEntity(T entity);

	public void updateEntity(T entity);

	public void deleteEntity(T entity);

	public void deleteEntityById(int id);

	public T loadEntity(final Class<T> entityClass, final int id);

	public T loadEntityById(int id);
	public T loadEntityByKey(String key,String value);
	
	public boolean isExitEntity(String key,String value);

	public List<T> loadAll();
	public PageUtils<T> loadAllByPage(PageUtils<T> pageUtils);
	public PageUtils<T> loadByPageAndKey(PageUtils<T> pageUtils,String key,int value);
	public long getTotalCount();
	public void flush();
}